General error: 1030 Got error 134 from storage engine

chris (2009-10-28 20:04:51)
2525 views
0 replies
if you get this message in your Mysql powered application, or error log, you are looking at a table corruption, which needs to be fixed using myisamchk. You can do this at the mysql prompt very simply as shown in this example:

mysql> check table sessions;
+-------------------+-------+----------+----------------------------------------------------------+
| Table             | Op    | Msg_type | Msg_text                                                 |
+-------------------+-------+----------+----------------------------------------------------------+
| torkalot.sessions | check | warning  | 7 clients are using or haven't closed the table properly | 
| torkalot.sessions | check | error    | Found 2 keys of 1                                        | 
| torkalot.sessions | check | error    | Corrupt                                                  | 
+-------------------+-------+----------+----------------------------------------------------------+
3 rows in set (54.76 sec)

mysql> repair table sessions;
+-------------------+--------+----------+----------+
| Table             | Op     | Msg_type | Msg_text |
+-------------------+--------+----------+----------+
| torkalot.sessions | repair | status   | OK       | 
+-------------------+--------+----------+----------+
1 row in set (0.20 sec)

mysql> check table sessions;
+-------------------+-------+----------+----------+
| Table             | Op    | Msg_type | Msg_text |
+-------------------+-------+----------+----------+
| torkalot.sessions | check | status   | OK       | 
+-------------------+-------+----------+----------+
1 row in set (0.00 sec)

mysql> 

So in this case, there appeared to be 3 issues reported by the check tool - there were 7 cases of clients which had opened the table, but not closed it properly (presumably not releasing locks on disconnect probably due to an unclean shutdown). I'm guessing, but probably the 'Found 2 keys of 1' would suggest a duplicate primary key situation.

Anyway, running the 'check table' and 'repair table' commands will save your day. You could equally run myisamchk from the command line.


christo
comment